public class Main {
    public static void main(String[] args) {


        System.out.println(checkQQ("2279538834"));
        System.out.println(checkQQ("222"));
        System.out.println(checkQQ("22222525d"));
        System.out.println(checkQQ(null));

    }

    public static boolean checkQQ(String qq){
        return qq!=null && qq.matches("\\d{6,20}");
    }



    public static boolean checkqq(String qq){
        if(qq == null || qq.length()<6 || qq.length()>20){
            return false;
        }
        for (int i = 0; i < qq.length(); i++) {
            char ch = qq.charAt(i);
            if(ch<'0' || ch>'9'){
                return false;
            }
        }
        return true;
    }
}
